package com.vehicle.comvehiclehealth;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;

public class MainActivity extends AppCompatActivity implements View.OnClickListener {

    private Button btnGuide1;
    private Button btnGuide2;

    private Button btnHeartRate;
    private Button btnBloodPres;
    private Button btnECG;
    private Button btnBody;
    private Button btnResult;
    private Button btnAccount;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
    }

    private void initView() {
        btnGuide1 = (Button)findViewById(R.id.btn_start_first);
        btnGuide2 = (Button)findViewById(R.id.btn_start_second);
        btnHeartRate = (Button)findViewById(R.id.btn_heart_rate);
        btnBloodPres = (Button)findViewById(R.id.btn_blood_pressure);
        btnECG = (Button)findViewById(R.id.btn_ecg);
        btnBody = (Button)findViewById(R.id.btn_body);
        btnResult = (Button)findViewById(R.id.btn_result);
        btnAccount = (Button)findViewById(R.id.btn_account);

        btnGuide1.setOnClickListener(this);
        btnGuide2.setOnClickListener(this);
        btnHeartRate.setOnClickListener(this);
        btnBloodPres.setOnClickListener(this);
        btnECG.setOnClickListener(this);
        btnBody.setOnClickListener(this);
        btnResult.setOnClickListener(this);
        btnAccount.setOnClickListener(this);

    }

    @Override
    public void onClick(View view) {
        Intent intent;
        switch (view.getId()) {
            case R.id.btn_start_first:
                intent = new Intent(this, GuideFirstActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_start_second:
                intent = new Intent(this, GuideSecondActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_heart_rate:
                intent = new Intent(this, MeasureHeartRateActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_blood_pressure:
                intent = new Intent(this, MeasureBloodPleasureActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_ecg:
                intent = new Intent(this, MeasureBloodPleasureActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_body:
                intent = new Intent(this, MeasureHeartRateActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_result:
                intent = new Intent(this, ResultActivity.class);
                startActivity(intent);
                break;
            case R.id.btn_account:
                intent = new Intent(this, AccountActivity.class);
                startActivity(intent);
                break;
        }
    }
}
